Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export HOSTNAME environment variable #26262

Merged
merged 1 commit into from
Aug 17, 2017

Conversation

jasontedor
Copy link
Member

We previously explicitly set the HOSTNAME environment variable so that ${HOSTNAME} could be used a placeholder for defining the node.name in elasticsearch.yml. We removed explicitly setting this because bash defines HOSTNAME. The problem is that bash defines HOSTNAME as a bash variable, not as an environment variable. Therefore, to restore the previous behavior, we export the bash value for HOSTNAME as an environment variable named HOSTNAME. For consistency between Windows and the Unix-like systems, we also define HOSTNAME with a value equal to the environment variable COMPUTERNAME on Windows.

Closes #26255, relates #25807

We previously explicitly set the HOSTNAME environment variable so that
${HOSTNAME} could be used a placeholder for defining the node.name in
elasticsearch.yml. We removed explicitly setting this because bash
defines HOSTNAME. The problem is that bash defines HOSTNAME as a bash
variable, not as an environment variable. Therefore, to restore the
previous behavior, we export the bash value for HOSTNAME as an
environment variable named HOSTNAME. For consistency between Windows and
the Unix-like systems, we also define HOSTNAME with a value equal to the
environment variable COMPUTERNAME on Windows.
@jasontedor jasontedor added :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts review v6.0.0 v6.1.0 v7.0.0 labels Aug 17, 2017
Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasontedor jasontedor merged commit 4e97be0 into elastic:master Aug 17, 2017
jasontedor added a commit that referenced this pull request Aug 17, 2017
We previously explicitly set the HOSTNAME environment variable so that
${HOSTNAME} could be used a placeholder for defining the node.name in
elasticsearch.yml. We removed explicitly setting this because bash
defines HOSTNAME. The problem is that bash defines HOSTNAME as a bash
variable, not as an environment variable. Therefore, to restore the
previous behavior, we export the bash value for HOSTNAME as an
environment variable named HOSTNAME. For consistency between Windows and
the Unix-like systems, we also define HOSTNAME with a value equal to the
environment variable COMPUTERNAME on Windows.

Relates #26262
jasontedor added a commit that referenced this pull request Aug 17, 2017
We previously explicitly set the HOSTNAME environment variable so that
${HOSTNAME} could be used a placeholder for defining the node.name in
elasticsearch.yml. We removed explicitly setting this because bash
defines HOSTNAME. The problem is that bash defines HOSTNAME as a bash
variable, not as an environment variable. Therefore, to restore the
previous behavior, we export the bash value for HOSTNAME as an
environment variable named HOSTNAME. For consistency between Windows and
the Unix-like systems, we also define HOSTNAME with a value equal to the
environment variable COMPUTERNAME on Windows.

Relates #26262
@jasontedor jasontedor deleted the export-hostname branch August 18, 2017 02:53
@lcawl lcawl removed the v6.1.0 label Dec 12, 2017
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team v6.0.0-beta2 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hostname environment variable no longer works in elasticsearch.yml when starting using systemd
5 participants